/* jshint indent: 2 */

module.exports = function (sequelize, DataTypes) {
  return sequelize.define(
    'admin',
    {
      id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
      },
      last_ip: {
        type: DataTypes.STRING(15),
        allowNull: true,
        defaultValue: '0.0.0.0',
      },
      user_name: {
        type: DataTypes.STRING(20),
        allowNull: false,
      },
      pass_word: {
        type: DataTypes.STRING(20),
        allowNull: false,
      },
      email: {
        type: DataTypes.STRING(50),
        allowNull: true,
      },
      name: {
        type: DataTypes.STRING(255),
        allowNull: true,
      },
      grade: {
        type: DataTypes.INTEGER(11),
      },
    },
    {
      tableName: 'admin',
      timestamps: false,
    }
  );
};
